package psi

import "strings"

/*
服药闹钟设置指令
可设置闹钟的提醒文字
平台发送:
[DW*YYYYYYYYYYYYYYY*LEN*REMIND_CH_MEDICINE,闹钟 1,闹钟 2,闹钟 3]
实例:
[DW*334588000000156*0018*REMIND_CH_MEDICINE,08:10，12:10]
终端回复:
[DW*YYYYYYYYYYYYYYY*LEN*REMIND_CH_MEDICINE]
实例:[DW*334588000000156*0006*REMIND_CH_MEDICINE]
说明:闹钟为时间点
*/

// 服药闹钟设置指令
type REMIND_CH_MEDICINE struct {
	Alarm1 string // 闹钟 1
	Alarm2 string // 闹钟 2
	Alarm3 string // 闹钟 3
}

func DealREMIND_CH_MEDICINE(method string, params map[string]interface{}) (string, error) {
	var remind REMIND_CH_MEDICINE
	err := MapToStruct(params, &remind)
	if err != nil {
		return "", err
	}
	var messageList []string
	messageList = append(messageList, "REMIND_CH_MEDICINE")
	messageList = append(messageList, remind.Alarm1)
	messageList = append(messageList, remind.Alarm2)
	messageList = append(messageList, remind.Alarm3)
	message := strings.Join(messageList, ",")
	return message, nil
}
